#include <iostream>
#include "SmartPointer.h"

using namespace std;
using namespace StructLib;


#define TestModel(x) if (x) {
#define END   }

enum TestModels
{
    AutoDestructor = true,
    StructorMethod = false,
};


 
class Test
{
public:
    Test()
    {
        cout << "Test()" << endl;
    }
    ~Test()
    {
        cout << "~Test()" << endl;
    }
};

void FunTest()
{
    SmartPointer<Test> sp = new Test();


    cout << "this is FunTest()" << endl;

//测试构造函数的多种方式（拷贝构造 和 赋值= 的区别）
TestModel(StructorMethod)
    SmartPointer<Test> b;
    b = sp;
    SmartPointer<Test> q = b;
END

}




int main()
{

//测试会不会自动析构
TestModel(AutoDestructor)
    FunTest();
    //Test *a = new Test();
END

    std::cout << "this main()" << std::endl;
    return 0;
}




